<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue组件</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>

<body>
    <div id="Application">
        <div>
            <input :value="inputText" @input="action" title="x"/>
            <div>{{inputText}}</div>
            <button @click="this.inputText=''">清空</button>
        </div>

    </div>
    <script>
        const App = Vue.createApp({
            data() {
                return { inputText: "" }
            },
            methods: {
                action(event) {
                    this.inputText = event.target.value
                }
            }
        })

        App.mount("#Application") 
    </script>
</body>

</html>